package com.huangpeng.designmodel.beanLifeCycle;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author hp
 * @Title bean生命周期代码演示
 * @Package
 * @Date 2022/1/7 17:33
 * @Description
 * @Version 1.0
 */
public class MyBeanPostProcessor implements BeanPostProcessor {
    public Object postProcessBeforeInitialization(Object bean,String beanName) throws BeansException {
        System.out.println("postProcessBeforeInitialization被调用beanName: " + beanName + "/bean: " + bean);
        return bean;
    }

    public Object postProcessAfterInitialization(Object bean,String beanName) throws BeansException {
        System.out.println("postProcessAfterInitialization被调用beanName: " + beanName + "/bean: " + bean);
        return bean;
    }
}
